package com.web.controller;

import com.dto.BaseDto;
import com.entity.Selleractivityrecord;
import com.page.PageInfo;
import com.web.service.SelleractivityrecordService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/selleractivityrecordController")
public class SelleractivityrecordController {
    @Resource
    SelleractivityrecordService selleractivityrecordService;

    @RequestMapping("/selleractivityrecords")
    @ResponseBody
   public BaseDto<Selleractivityrecord> getAll() throws Exception{
//        System.out.println("getAll");
//       List<Student> students = Arrays.asList(new Student[]{new Student("0901", "张三"), new Student("0902", "李四"), new Student("0901", "王二")});
//       return students;
        return selleractivityrecordService.getAll();
   }


    @RequestMapping("/selleractivityrecords/page")
    @ResponseBody
    public BaseDto< Selleractivityrecord> getSelleractivityrecordsByPage(PageInfo pageInfo) throws Exception{

        return selleractivityrecordService.getSelleractivityrecordsByPage(pageInfo);
    }


}
